package com.mrkun.vueshop.mapper;

import com.mrkun.vueshop.model.OrderInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author by yong
 * @date 2020/3/22
 */
@Mapper
public interface OrderInfoMapper {

    @Select("select * from order_info where date = #{date} and order_id = #{orderId}")
    OrderInfo findByDateAndOrderId(@Param("date")String date,@Param("orderId")Integer orderId);

    @Insert("insert into order_info (order_id,date,total_money,income) values (#{orderId},#{date},#{totalMoney},#{income})")
    void addOrderInfo(OrderInfo orderInfo);
}
